﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AspNetCs.Bll;
using AspNetCs.Model;
using AspNetCs.Common;

public partial class Users_Admin_photoClassAdd : Admin_BasePage
{
    protected UserPhoto UphotoBll = new UserPhoto();
    protected void Page_Load(object sender, EventArgs e)
    {
        IsExit();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        UserPhoto_Class_Model md = new UserPhoto_Class_Model();
        md.ClassName = StringHelper.RemoveHtml(Txt_ClassName.Text);
        md.Readme = StringHelper.RemoveHtml(Txt_Readme.Text);

        if (md.ClassName == "")
        {
            ShowMsgBack("分类名称不能为空");
            Response.End();
        }

        if (UphotoBll.AddClass(md) > 0)
        {
            ResultStr("Admin_photoClass.aspx", "添加分类成功");
        }
        else
        {
            ShowMsgBack("添加分类失败");
            Response.End();
        }
    }
}
